<template>
  <div class="card-container">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span class="card-title">统计</span>
          <button class="custom-btn btn-12">
            <span @click="handleSwitchThemes">Click!</span><span>切换主题</span>
          </button>
        </div>
      </template>
      <el-row :gutter="20" class="card-item-container">
        <el-col :span="8" class="card-item">
          <RadialChart />
        </el-col>
        <el-col :span="16" class="card-item">
          <LineChart />
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script lang="ts" setup>
import { useMain } from "@/store";
import RadialChart from "@/components/RadialChart/index.vue";
import LineChart from "@/components/LineChart/index.vue";
const mainStore = useMain();
const handleSwitchThemes = () => {
  mainStore.setShowTheme(true);
};
</script>

<style scoped lang="scss">
@import "@/styles/variable.module";

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-item-container {
  color: #c0c4cc;
  padding: 0 20px;

  .card-item {
    cursor: pointer;
  }
}

.card-title {
  font-size: 1rem;
  font-weight: bold;
}

:deep(.el-card__header) {
  border-bottom: none;
  padding: 25px;
}

:deep(.el-card__body) {
  padding: 0;
}

.box-card {
  background-color: $themeSecondaryColor;
  color: aliceblue;
  border: none;
  box-shadow:
    5px 5px 17px $themeSecondaryColor,
    -5px -5px 17px $themeSecondaryColor;
}

.text {
  font-size: 14px;
}

/* 12 */
.custom-btn {
  width: 130px;
  height: 40px;
  color: #fff;
  border-radius: 5px;
  padding: 10px 25px;
  font-family: "Lato", sans-serif;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
  box-shadow:
    inset 2px 2px 2px 0 rgba(255, 255, 255, 0.5),
    7px 7px 20px 0 rgba(0, 0, 0, 0.1),
    4px 4px 5px 0 rgba(0, 0, 0, 0.1);
  outline: none;
}

.btn-12 {
  position: relative;
  right: 20px;
  bottom: 20px;
  border: none;
  box-shadow: none;
  width: 130px;
  height: 40px;
  line-height: 42px;
  -webkit-perspective: 230px;
  perspective: 230px;
}

.btn-12 span {
  background: rgb(0, 172, 238);
  background: linear-gradient(
    0deg,
    rgba(0, 172, 238, 1) 0%,
    rgba(2, 126, 251, 1) 100%
  );
  display: block;
  position: absolute;
  width: 130px;
  height: 40px;
  border-radius: 5px;
  margin: 0;
  text-align: center;
  box-sizing: border-box;
  -webkit-transition: all 0.3s;
  transition: all 0.3s;
}

.btn-12 span:nth-child(1) {
  transform: rotateX(90deg);
  -webkit-transform-origin: 50% 50% -20px;
  transform-origin: 50% 50% -20px;
}

.btn-12 span:nth-child(2) {
  transform: rotateX(0deg);
  -webkit-transform-origin: 50% 50% -20px;
  transform-origin: 50% 50% -20px;
}

.btn-12:hover span:nth-child(1) {
  box-shadow:
    inset 2px 2px 2px 0 rgba(255, 255, 255, 0.5),
    7px 7px 20px 0 rgba(0, 0, 0, 0.1),
    4px 4px 5px 0 rgba(0, 0, 0, 0.1);
  transform: rotateX(0deg);
}

.btn-12:hover span:nth-child(2) {
  box-shadow:
    inset 2px 2px 2px 0 rgba(255, 255, 255, 0.5),
    7px 7px 20px 0 rgba(0, 0, 0, 0.1),
    4px 4px 5px 0 rgba(0, 0, 0, 0.1);
  color: transparent;
  transform: rotateX(-90deg);
}
</style>
